<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">

<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>gamvas.Actor</title><link rel="stylesheet" type="text/css" href="../styles/main.css"><script language=JavaScript src="../javascript/main.js"></script><script language=JavaScript src="../javascript/prettify.js"></script><script language=JavaScript src="../javascript/searchdata.js"></script></head><body class="ContentPage" onLoad="NDOnLoad();prettyPrint();"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>

<!--  Generated by Natural Docs, version 1.51 -->
<!--  http://www.naturaldocs.org  -->

<!-- saved from url=(0026)http://www.naturaldocs.org -->




<div id=Content><div class="CClass"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="gamvas.Actor"></a>gamvas.<wbr>Actor</h1><div class=CBody><h4 class=CHeading>Description</h4><p>The actor class is the most important class in gamvas.&nbsp; You use it for the player, ai opponents, physics objects, maybe even static objects in your gameworld.&nbsp; It forms a object that can hold animations, physical properties, states, logic and can react to events like keyboard or mouse input or collisions.&nbsp; Actors hold a default animation and a default state, so if you only need one of them, you can use these, see example below.</p><h4 class=CHeading>Constructur</h4><p>new gamvas.Actor(name, x, y);</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>name</td><td class=CDLDescription>a unique name in the game world or false to let the name autogenerate</td></tr><tr><td class=CDLEntry>x/y</td><td class=CDLDescription>the position of the actors center in the world (optional)</td></tr></table><h4 class=CHeading>See</h4><p><a href="gamvas-actorstate-js.html#gamvas.ActorState" class=LClass id=link60 onMouseOver="ShowTip(event, 'tt41', 'link60')" onMouseOut="HideTip('tt41')">gamvas.ActorState</a> <a href="gamvas-class-js.html#gamvas.Class" class=LClass id=link61 onMouseOver="ShowTip(event, 'tt57', 'link61')" onMouseOut="HideTip('tt57')">gamvas.Class</a> <a href="gamvas-image-js.html#gamvas.Image" class=LClass id=link62 onMouseOver="ShowTip(event, 'tt58', 'link62')" onMouseOut="HideTip('tt58')">gamvas.Image</a></p><h4 class=CHeading>Example</h4><blockquote><pre>// extend gamvas.Actor to create a new instancable actor
myActor = gamvas.Actor.extend({
    // the create function is the constructor
    create: function(name, x, y) {
        // call our super class constructor to initialize the actor
        this._super(name, x, y);
        // get our current state to get access to the resource handler
        var st = gamvas.state.getCurrentState();
        // load our animation with 64x64 pixels per frames, 10 frames
        // playing with 20 frames per second
        this.setFile(st.resource.getImage('anim.png'), 64, 64, 10, 20);
        // get default actor state
        var defState = this.myActor.getCurrentState();
        // install brain, move 10 pixels per second to the right
        defState.update = function(t) {
            this.actor.move(10*t, 0);
        };
    }
});</pre></blockquote><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#gamvas.Actor" >gamvas.<wbr>Actor</a></td><td class=SDescription>The actor class is the most important class in gamvas. </td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#gamvas.Actor.Variables" >Variables</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#gamvas.Actor.name" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">name</a></td><td class=SDescription>The name of the actor</td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#gamvas.Actor.position" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">position</a></td><td class=SDescription>A <a href="gamvas-vector2d-js.html#gamvas.Vector2D" class=LClass id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">gamvas.Vector2D</a> object with the position information</td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#gamvas.Actor.center" id=link4 onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">center</a></td><td class=SDescription>A <a href="gamvas-vector2d-js.html#gamvas.Vector2D" class=LClass id=link5 onMouseOver="ShowTip(event, 'tt3', 'link5')" onMouseOut="HideTip('tt3')">gamvas.Vector2D</a> object with the center offset of the actor</td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#gamvas.Actor.currentAnimation" id=link6 onMouseOver="ShowTip(event, 'tt5', 'link6')" onMouseOut="HideTip('tt5')">currentAnimation</a></td><td class=SDescription>The name of the current animation</td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#gamvas.Actor.rotation" id=link7 onMouseOver="ShowTip(event, 'tt6', 'link7')" onMouseOut="HideTip('tt6')">rotation</a></td><td class=SDescription>The rotation of the actor</td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#gamvas.Actor.scaleFactor" id=link8 onMouseOver="ShowTip(event, 'tt7', 'link8')" onMouseOut="HideTip('tt7')">scaleFactor</a></td><td class=SDescription>The scale factor of the object</td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#gamvas.Actor.density" id=link9 onMouseOver="ShowTip(event, 'tt8', 'link9')" onMouseOut="HideTip('tt8')">density</a></td><td class=SDescription>The physical property of density. </td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#gamvas.Actor.friction" id=link10 onMouseOver="ShowTip(event, 'tt9', 'link10')" onMouseOut="HideTip('tt9')">friction</a></td><td class=SDescription>The physical property of friction Defines the friction of objects. </td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#gamvas.Actor.resitution" >resitution</a></td><td class=SDescription>The physical property of resitution (bounce). </td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#gamvas.Actor.type" id=link11 onMouseOver="ShowTip(event, 'tt10', 'link11')" onMouseOut="HideTip('tt10')">type</a></td><td class=SDescription>Allows you to set types to your physics objects to identify them. </td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#gamvas.Actor.layer" id=link12 onMouseOver="ShowTip(event, 'tt11', 'link12')" onMouseOut="HideTip('tt11')">layer</a></td><td class=SDescription>Integer value used for z-sorting on automatic draw through <a href="gamvas-state-state-js.html#gamvas.State.addActor" class=LFunction id=link13 onMouseOver="ShowTip(event, 'tt12', 'link13')" onMouseOut="HideTip('tt12')">gamvas.State.addActor</a></td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#gamvas.Actor.usePhysics" id=link14 onMouseOver="ShowTip(event, 'tt13', 'link14')" onMouseOut="HideTip('tt13')">usePhysics</a></td><td class=SDescription>Delivers true/false if this object has physics enabled. </td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#gamvas.Actor.body" id=link15 onMouseOver="ShowTip(event, 'tt14', 'link15')" onMouseOut="HideTip('tt14')">body</a></td><td class=SDescription>The Box2D b2Body, if physics is enabled</td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#gamvas.Actor.fixture" id=link16 onMouseOver="ShowTip(event, 'tt15', 'link16')" onMouseOut="HideTip('tt15')">fixture</a></td><td class=SDescription>The Box2D b2Fixture, if physics is enabled</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#gamvas.Actor.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.Actor.init" id=link17 onMouseOver="ShowTip(event, 'tt16', 'link17')" onMouseOut="HideTip('tt16')">init</a></td><td class=SDescription>Description</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.Actor.addState" id=link18 onMouseOver="ShowTip(event, 'tt17', 'link18')" onMouseOut="HideTip('tt17')">addState</a></td><td class=SDescription>Adds a actor state</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.Actor.addAnimation" id=link19 onMouseOver="ShowTip(event, 'tt18', 'link19')" onMouseOut="HideTip('tt18')">addAnimation</a></td><td class=SDescription>Adds a animation</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.Actor.createBody" id=link20 onMouseOver="ShowTip(event, 'tt19', 'link20')" onMouseOut="HideTip('tt19')">createBody</a></td><td class=SDescription>Create a Box2D b2Body object for the actor. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.Actor.bodyRect" id=link21 onMouseOver="ShowTip(event, 'tt20', 'link21')" onMouseOut="HideTip('tt20')">bodyRect</a></td><td class=SDescription>make the actor a physics object with a rectangular body shape</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.Actor.bodyCircle" id=link22 onMouseOver="ShowTip(event, 'tt21', 'link22')" onMouseOut="HideTip('tt21')">bodyCircle</a></td><td class=SDescription>make the actor a physics object with a circle as body shape</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.Actor.bodyPolygon" id=link23 onMouseOver="ShowTip(event, 'tt22', 'link23')" onMouseOut="HideTip('tt22')">bodyPolygon</a></td><td class=SDescription>make the actor a physics object with a non rectangular polygon shape If you just need a rectangle, there is a shortcut: &lt;gamvas.actor.bodyRect&gt;</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.Actor.resetForces" id=link24 onMouseOver="ShowTip(event, 'tt23', 'link24')" onMouseOut="HideTip('tt23')">resetForces</a></td><td class=SDescription>Resets all physical forces on the actor</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.Actor.setBullet" id=link25 onMouseOver="ShowTip(event, 'tt24', 'link25')" onMouseOut="HideTip('tt24')">setBullet</a></td><td class=SDescription>Defines if a actor is a physics &lsquo;bullet&rsquo;.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.Actor.setSensor" id=link26 onMouseOver="ShowTip(event, 'tt25', 'link26')" onMouseOut="HideTip('tt25')">setSensor</a></td><td class=SDescription>Defines if a actor is a physics sensor or not</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.Actor.setAwake" id=link27 onMouseOver="ShowTip(event, 'tt26', 'link27')" onMouseOut="HideTip('tt26')">setAwake</a></td><td class=SDescription>Allows you to wake (or sleep) a actor in the physics simulation</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.Actor.setFixedRotation" id=link28 onMouseOver="ShowTip(event, 'tt27', 'link28')" onMouseOut="HideTip('tt27')">setFixedRotation</a></td><td class=SDescription>Object does not rotate, when under physics controll</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.Actor.setName" id=link29 onMouseOver="ShowTip(event, 'tt28', 'link29')" onMouseOut="HideTip('tt28')">setName</a></td><td class=SDescription>Set the actor name</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.Actor.setRotation" id=link30 onMouseOver="ShowTip(event, 'tt29', 'link30')" onMouseOut="HideTip('tt29')">setRotation</a></td><td class=SDescription>Set certain rotation of the actor in radians</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.Actor.rotate" id=link31 onMouseOver="ShowTip(event, 'tt30', 'link31')" onMouseOut="HideTip('tt30')">rotate</a></td><td class=SDescription>Rotate the actor</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.Actor.setPosition" id=link32 onMouseOver="ShowTip(event, 'tt31', 'link32')" onMouseOut="HideTip('tt31')">setPosition</a></td><td class=SDescription>Set the position of a actor</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.Actor.move" id=link33 onMouseOver="ShowTip(event, 'tt32', 'link33')" onMouseOut="HideTip('tt32')">move</a></td><td class=SDescription>Move the actor</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.Actor.setScale" id=link34 onMouseOver="ShowTip(event, 'tt33', 'link34')" onMouseOut="HideTip('tt33')">setScale</a></td><td class=SDescription>Set a certain scale factor</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.Actor.scale" id=link35 onMouseOver="ShowTip(event, 'tt34', 'link35')" onMouseOut="HideTip('tt34')">scale</a></td><td class=SDescription>Scale a object</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.Actor.setLinearDamping" id=link36 onMouseOver="ShowTip(event, 'tt35', 'link36')" onMouseOut="HideTip('tt35')">setLinearDamping</a></td><td class=SDescription>Sets the linear damping of the physics object.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.Actor.setAngularDamping" id=link37 onMouseOver="ShowTip(event, 'tt36', 'link37')" onMouseOut="HideTip('tt36')">setAngularDamping</a></td><td class=SDescription>Sets the angular damping of the physics object.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.Actor.setCenter" id=link38 onMouseOver="ShowTip(event, 'tt37', 'link38')" onMouseOut="HideTip('tt37')">setCenter</a></td><td class=SDescription>Set the center for an actor. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.Actor.getCurrentAnimation" id=link39 onMouseOver="ShowTip(event, 'tt38', 'link39')" onMouseOut="HideTip('tt38')">getCurrentAnimation</a></td><td class=SDescription>Get the current <a href="gamvas-animation-js.html#gamvas.Animation" class=LClass id=link40 onMouseOver="ShowTip(event, 'tt39', 'link40')" onMouseOut="HideTip('tt39')">gamvas.Animation</a> object that is playing</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.Actor.getCurrentState" id=link41 onMouseOver="ShowTip(event, 'tt40', 'link41')" onMouseOut="HideTip('tt40')">getCurrentState</a></td><td class=SDescription>Get the current <a href="gamvas-actorstate-js.html#gamvas.ActorState" class=LClass id=link42 onMouseOver="ShowTip(event, 'tt41', 'link42')" onMouseOut="HideTip('tt41')">gamvas.ActorState</a> the actor is in</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.Actor.setFile" id=link43 onMouseOver="ShowTip(event, 'tt42', 'link43')" onMouseOut="HideTip('tt42')">setFile</a></td><td class=SDescription>Sets a image file for the current animation</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.Actor.preDraw" id=link44 onMouseOver="ShowTip(event, 'tt43', 'link44')" onMouseOut="HideTip('tt43')">preDraw</a></td><td class=SDescription>Gets called after screen clear and before camera handling.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.Actor.draw" id=link45 onMouseOver="ShowTip(event, 'tt44', 'link45')" onMouseOut="HideTip('tt44')">draw</a></td><td class=SDescription>Gets called when the actor is drawn. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.Actor.postDraw" id=link46 onMouseOver="ShowTip(event, 'tt45', 'link46')" onMouseOut="HideTip('tt45')">postDraw</a></td><td class=SDescription>Gets called after camera handling.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.Actor.isActive" id=link47 onMouseOver="ShowTip(event, 'tt46', 'link47')" onMouseOut="HideTip('tt46')">isActive</a></td><td class=SDescription>Check if the actor is active</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.Actor.setActive" id=link48 onMouseOver="ShowTip(event, 'tt47', 'link48')" onMouseOut="HideTip('tt47')">setActive</a></td><td class=SDescription>Enable or disable the actor for automatic drawing (if in states actors list)</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.Actor.setState" id=link49 onMouseOver="ShowTip(event, 'tt48', 'link49')" onMouseOut="HideTip('tt48')">setState</a></td><td class=SDescription>Switch the actor to a certain <a href="gamvas-actorstate-js.html#gamvas.ActorState" class=LClass id=link50 onMouseOver="ShowTip(event, 'tt41', 'link50')" onMouseOut="HideTip('tt41')">gamvas.ActorState</a></td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.Actor.setAnimation" id=link51 onMouseOver="ShowTip(event, 'tt49', 'link51')" onMouseOut="HideTip('tt49')">setAnimation</a></td><td class=SDescription>Switch the actor to a certain <a href="gamvas-animation-js.html#gamvas.Animation" class=LClass id=link52 onMouseOver="ShowTip(event, 'tt39', 'link52')" onMouseOut="HideTip('tt39')">gamvas.Animation</a></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.Actor.setFPS" id=link53 onMouseOver="ShowTip(event, 'tt50', 'link53')" onMouseOut="HideTip('tt50')">setFPS</a></td><td class=SDescription>Sets the frames per seconds of the current animation</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.Actor.setFrameList" id=link54 onMouseOver="ShowTip(event, 'tt51', 'link54')" onMouseOut="HideTip('tt51')">setFrameList</a></td><td class=SDescription>Sets the list of frames of the current animation</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.Actor.setGroupIndex" id=link55 onMouseOver="ShowTip(event, 'tt52', 'link55')" onMouseOut="HideTip('tt52')">setGroupIndex</a></td><td class=SDescription>Set the Box2D filter group index</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.Actor.setCategoryBits" id=link56 onMouseOver="ShowTip(event, 'tt53', 'link56')" onMouseOut="HideTip('tt53')">setCategoryBits</a></td><td class=SDescription>Sets the Box2D category bits</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.Actor.setMaskBits" id=link57 onMouseOver="ShowTip(event, 'tt54', 'link57')" onMouseOut="HideTip('tt54')">setMaskBits</a></td><td class=SDescription>Sets the Box2D mask bits</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.Actor.addRevoluteJoint" id=link58 onMouseOver="ShowTip(event, 'tt55', 'link58')" onMouseOut="HideTip('tt55')">addRevoluteJoint</a></td><td class=SDescription>Add a Box2D revolute joint between this actor and another</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.Actor.addPrismaticJoint" id=link59 onMouseOver="ShowTip(event, 'tt56', 'link59')" onMouseOut="HideTip('tt56')">addPrismaticJoint</a></td><td class=SDescription>Add a Box2D prismatic joint between this actor and another</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.Variables"></a>Variables</h3></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.name"></a>name</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.name</td></tr></table></blockquote><p>The name of the actor</p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.position"></a>position</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.position</td></tr></table></blockquote><p>A <a href="gamvas-vector2d-js.html#gamvas.Vector2D" class=LClass id=link63 onMouseOver="ShowTip(event, 'tt3', 'link63')" onMouseOut="HideTip('tt3')">gamvas.Vector2D</a> object with the position information</p><h4 class=CHeading>See</h4><p>&lt;gamvas.actor.setPosition&gt; &lt;gamvas.actor.move&gt;</p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.center"></a>center</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.center</td></tr></table></blockquote><p>A <a href="gamvas-vector2d-js.html#gamvas.Vector2D" class=LClass id=link64 onMouseOver="ShowTip(event, 'tt3', 'link64')" onMouseOut="HideTip('tt3')">gamvas.Vector2D</a> object with the center offset of the actor</p><h4 class=CHeading>See</h4><p>&lt;gamvas.actor.setCenter&gt;</p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.currentAnimation"></a>currentAnimation</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.currentAnimation</td></tr></table></blockquote><p>The name of the current animation</p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.rotation"></a>rotation</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.rotation</td></tr></table></blockquote><p>The rotation of the actor</p><h4 class=CHeading>See</h4><p>&lt;gamvas.actor.setRotation&gt; &lt;gamvas.actor.rotate&gt;</p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.scaleFactor"></a>scaleFactor</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.scaleFactor</td></tr></table></blockquote><p>The scale factor of the object</p><h4 class=CHeading>Note</h4><p>Scaling actors does not work with physics.&nbsp; Well... scaling does, but the physics collision box will not be scaled.</p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.density"></a>density</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.density</td></tr></table></blockquote><p>The physical property of density.&nbsp; In case of impact, objects with higher density will push objects with lower density away more.</p><h4 class=CHeading>Default</h4><p>1.0</p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.friction"></a>friction</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.friction</td></tr></table></blockquote><p>The physical property of friction Defines the friction of objects.&nbsp; A ice ground would have a very low friction, maybe 0.1 or less, while a rubber ground would have a high value, close to 1.0.&nbsp; So if you would push a ball over these grounds, on the low friction ice ground, the ball might slip over where as on the high friction rubber ground it would immediately start to roll.</p><h4 class=CHeading>Default</h4><p>0.5</p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.resitution"></a>resitution</h3><div class=CBody><p>The physical property of resitution (bounce).&nbsp; Defines how bouncy a object is.&nbsp; A value of 1.0 means, that if falling to the ground, the object would jump exactly as high up as it fell down, wile smaller values will give a more natural bouncyness where with every bounce, it would bounce less, until it stops bouncing.</p><h4 class=CHeading>Default</h4><p>0.3</p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.type"></a>type</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.type</td></tr></table></blockquote><p>Allows you to set types to your physics objects to identify them.&nbsp; You could for example use &ldquo;player&rdquo;, &ldquo;wall&rdquo;, &ldquo;opponent&rdquo;, &ldquo;tree&rdquo; to identify what type of object you are colliding and react accordingly.</p><h4 class=CHeading>Default</h4><p>empty string</p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.layer"></a>layer</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.layer</td></tr></table></blockquote><p>Integer value used for z-sorting on automatic draw through <a href="gamvas-state-state-js.html#gamvas.State.addActor" class=LFunction id=link65 onMouseOver="ShowTip(event, 'tt12', 'link65')" onMouseOut="HideTip('tt12')">gamvas.State.addActor</a></p><h4 class=CHeading>Note</h4><p>Versions prior 0.8.3 used the layer value in the wrong direction, if you have used gamvas before this version, see <a href="gamvas-config-js.html#gamvas.config.reverseLayerOrder" class=LVariable id=link66 onMouseOver="ShowTip(event, 'tt59', 'link66')" onMouseOut="HideTip('tt59')">gamvas.config.reverseLayerOrder</a></p><h4 class=CHeading>Default</h4><p>0</p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.usePhysics"></a>usePhysics</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.usePhysics</td></tr></table></blockquote><p>Delivers true/false if this object has physics enabled.&nbsp; This is meant to be read only, it will be set automatically when creating a physics body.</p><h4 class=CHeading>See</h4><p><a href="#gamvas.Actor.createBody" class=LFunction id=link67 onMouseOver="ShowTip(event, 'tt19', 'link67')" onMouseOut="HideTip('tt19')">gamvas.Actor.createBody</a> <a href="#gamvas.Actor.bodyRect" class=LFunction id=link68 onMouseOver="ShowTip(event, 'tt20', 'link68')" onMouseOut="HideTip('tt20')">gamvas.Actor.bodyRect</a> <a href="#gamvas.Actor.bodyCircle" class=LFunction id=link69 onMouseOver="ShowTip(event, 'tt21', 'link69')" onMouseOut="HideTip('tt21')">gamvas.Actor.bodyCircle</a> <a href="#gamvas.Actor.bodyPolygon" class=LFunction id=link70 onMouseOver="ShowTip(event, 'tt22', 'link70')" onMouseOut="HideTip('tt22')">gamvas.Actor.bodyPolygon</a></p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.body"></a>body</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.body</td></tr></table></blockquote><p>The Box2D b2Body, if physics is enabled</p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.fixture"></a>fixture</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.fixture</td></tr></table></blockquote><p>The Box2D b2Fixture, if physics is enabled</p></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.Functions"></a>Functions</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.init"></a>init</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">init: function()</td></tr></table></blockquote><p>Description</p><p>Overwrite with code to get executed on actor initialisation</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.addState"></a>addState</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>addState: function(</td><td class="PParameter  prettyprint " nowrap>state,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>activate</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Adds a actor state</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>state</td><td class=CDLDescription>a <a href="gamvas-actorstate-js.html#gamvas.ActorState" class=LClass id=link71 onMouseOver="ShowTip(event, 'tt41', 'link71')" onMouseOut="HideTip('tt41')">gamvas.ActorState</a> object</td></tr><tr><td class=CDLEntry>activate</td><td class=CDLDescription>if true, immediately switch to the new state (optional)</td></tr></table><h4 class=CHeading>Example</h4><blockquote><pre>myRunningState = gamvas.ActorState.extend({
    update: function(t) {
         this.actor.move(100*t, 0);
    },
    onKeyUp: function(keyCode) {
        if ( (keyCode == gamvas.key.RIGHT) || (keyCode = gamvas.key.LEFT) ) {
            this.actor.setState('walking');
        }
    }
});
myActor = gamvas.Actor.extend({
    create: function(name, x, y) {
        this._super(name, x, y);
        this.addState(new myRunningState('running'));
    }
});</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.addAnimation"></a>addAnimation</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>addAnimation: function(</td><td class="PParameter  prettyprint " nowrap>anim</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Adds a animation</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>anim</td><td class=CDLDescription>a <a href="gamvas-animation-js.html#gamvas.Animation" class=LClass id=link72 onMouseOver="ShowTip(event, 'tt39', 'link72')" onMouseOut="HideTip('tt39')">gamvas.Animation</a> object</td></tr></table><h4 class=CHeading>Example</h4><blockquote><pre>myActor = gamvas.Actor.extend({
    create: function(name, x, y) {
        this._super(name, x, ,y);
        this.addAnimation(
            new gamvas.Animation('running', this.resource.getImage('playerRun.png'), 64, 64, 12, 20)
        );
    }
});</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.createBody"></a>createBody</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>createBody: function(</td><td class="PParameter  prettyprint " nowrap>type,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>shape</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Create a Box2D b2Body object for the actor.&nbsp; This is the most flexible way to create a body, but you have to do the Box2D stuff quite low level</p><h4 class=CHeading>Note</h4><p>This is the low level function to add physics to your object.&nbsp; Unless you are required to for some reason, you would normally not use this function directly, but use <a href="#gamvas.Actor.bodyRect" class=LFunction id=link73 onMouseOver="ShowTip(event, 'tt20', 'link73')" onMouseOut="HideTip('tt20')">gamvas.Actor.bodyRect</a>, <a href="#gamvas.Actor.bodyCircle" class=LFunction id=link74 onMouseOver="ShowTip(event, 'tt21', 'link74')" onMouseOut="HideTip('tt21')">gamvas.Actor.bodyCircle</a> or <a href="#gamvas.Actor.bodyPolygon" class=LFunction id=link75 onMouseOver="ShowTip(event, 'tt22', 'link75')" onMouseOut="HideTip('tt22')">gamvas.Actor.bodyPolygon</a></p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>type</td><td class=CDLDescription>the Box2D body type (dynamic/static/...)</td></tr><tr><td class=CDLEntry>shape</td><td class=CDLDescription>the Box2D shape for collision detection</td></tr></table><h4 class=CHeading>Types</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>gamvas.physics.DYNAMIC</td><td class=CDLDescription>A body that moves, collides, etc (<a href="gamvas-physics-js.html#gamvas.physics.DYNAMIC" class=LMacro id=link76 onMouseOver="ShowTip(event, 'tt60', 'link76')" onMouseOut="HideTip('tt60')">gamvas.physics.DYNAMIC</a>)</td></tr><tr><td class=CDLEntry>gamvas.physics.STATIC</td><td class=CDLDescription>A body that does not move, like ground, walls, etc (<a href="gamvas-physics-js.html#gamvas.physics.STATIC" class=LMacro id=link77 onMouseOver="ShowTip(event, 'tt61', 'link77')" onMouseOut="HideTip('tt61')">gamvas.physics.STATIC</a>)</td></tr><tr><td class=CDLEntry>gamvas.physics.KINEMATIC</td><td class=CDLDescription>A body that does move, but under player or AI controll (<a href="gamvas-physics-js.html#gamvas.physics.KINEMATIC" class=LMacro id=link78 onMouseOver="ShowTip(event, 'tt62', 'link78')" onMouseOut="HideTip('tt62')">gamvas.physics.KINEMATIC</a>)</td></tr></table><h4 class=CHeading>See</h4><p><a href="#gamvas.Actor.bodyRect" class=LFunction id=link79 onMouseOver="ShowTip(event, 'tt20', 'link79')" onMouseOut="HideTip('tt20')">gamvas.Actor.bodyRect</a> <a href="#gamvas.Actor.bodyPolygon" class=LFunction id=link80 onMouseOver="ShowTip(event, 'tt22', 'link80')" onMouseOut="HideTip('tt22')">gamvas.Actor.bodyPolygon</a> <a href="#gamvas.Actor.bodyCircle" class=LFunction id=link81 onMouseOver="ShowTip(event, 'tt21', 'link81')" onMouseOut="HideTip('tt21')">gamvas.Actor.bodyCircle</a></p><h4 class=CHeading>Example</h4><blockquote><pre>myPlayer = gamvas.Actor.extend({
    create: function(name, x ,y) {
        this._super(name, x, y);
        // create a polygon shape
        var shape = new Box2D.Collision.Shapes.b2PolygonShape;
        // create a box shape with 200 by 100 pixels
        // NOTE: For demonstration only, use gamvas.Actor.bodyRect for this scenario
        shape.SetAsBox(gamvas.physics.toWorld(200), gamvas.physics.toWorld(100));
        // now finally create the body, adds the actor to physics simulation automatically
        this.createBody(gamvas.physics.DYNAMIC, shape);
    }
});</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.bodyRect"></a>bodyRect</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>bodyRect: function(</td><td class="PParameter  prettyprint " nowrap>x,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>y,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>width,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>height,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>type</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>make the actor a physics object with a rectangular body shape</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>x/y</td><td class=CDLDescription>the position of the body in the physics world</td></tr><tr><td class=CDLEntry>width/height</td><td class=CDLDescription>the half dimension of the rectangle, in pixels</td></tr><tr><td class=CDLEntry>type</td><td class=CDLDescription>the Box2D body type (See <a href="#gamvas.Actor.createBody" class=LFunction id=link82 onMouseOver="ShowTip(event, 'tt19', 'link82')" onMouseOut="HideTip('tt19')">gamvas.Actor.createBody</a>) (optional)</td></tr></table><h4 class=CHeading>See</h4><p><a href="#gamvas.Actor.createBody" class=LFunction id=link83 onMouseOver="ShowTip(event, 'tt19', 'link83')" onMouseOut="HideTip('tt19')">gamvas.Actor.createBody</a> <a href="#gamvas.Actor.bodyPolygon" class=LFunction id=link84 onMouseOver="ShowTip(event, 'tt22', 'link84')" onMouseOut="HideTip('tt22')">gamvas.Actor.bodyPolygon</a> <a href="#gamvas.Actor.bodyCircle" class=LFunction id=link85 onMouseOver="ShowTip(event, 'tt21', 'link85')" onMouseOut="HideTip('tt21')">gamvas.Actor.bodyCircle</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.bodyCircle"></a>bodyCircle</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>bodyCircle: function(</td><td class="PParameter  prettyprint " nowrap>x,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>y,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>radius,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>type</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>make the actor a physics object with a circle as body shape</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>x/y</td><td class=CDLDescription>the position of the body in the physics world</td></tr><tr><td class=CDLEntry>radius</td><td class=CDLDescription>the radius of the circle in pixels</td></tr><tr><td class=CDLEntry>type</td><td class=CDLDescription>the Box2D body type (See <a href="#gamvas.Actor.createBody" class=LFunction id=link86 onMouseOver="ShowTip(event, 'tt19', 'link86')" onMouseOut="HideTip('tt19')">gamvas.Actor.createBody</a>) (optional)</td></tr></table><h4 class=CHeading>See</h4><p><a href="#gamvas.Actor.createBody" class=LFunction id=link87 onMouseOver="ShowTip(event, 'tt19', 'link87')" onMouseOut="HideTip('tt19')">gamvas.Actor.createBody</a> <a href="#gamvas.Actor.bodyRect" class=LFunction id=link88 onMouseOver="ShowTip(event, 'tt20', 'link88')" onMouseOut="HideTip('tt20')">gamvas.Actor.bodyRect</a> <a href="#gamvas.Actor.bodyPolygon" class=LFunction id=link89 onMouseOver="ShowTip(event, 'tt22', 'link89')" onMouseOut="HideTip('tt22')">gamvas.Actor.bodyPolygon</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.bodyPolygon"></a>bodyPolygon</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>bodyPolygon: function(</td><td class="PParameter  prettyprint " nowrap>x,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>y,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>polys,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>cx,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>cy,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>type</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>make the actor a physics object with a non rectangular polygon shape If you just need a rectangle, there is a shortcut: &lt;gamvas.actor.bodyRect&gt;</p><h4 class=CHeading>Note</h4><p>Although Box2D documentation requires a counter clock wise (CCW) polygon, gamvas does require you to secify a clock wise polygon, as in the gamvas worl, the y axis represents screen pixels and therefor runs down, whereas Box2D world represents a real life world, where positive values on the y axis run up.</p><h4 class=CHeading>Important</h4><p>Box2D does not collide concave polygons (as in curving inward, like a skateboard ramp), make sure your polygons are convex (as in curving outward, like a hexagon).</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>x/y</td><td class=CDLDescription>the position of the body in the physics world</td></tr><tr><td class=CDLEntry>polys</td><td class=CDLDescription>a array holding arrays of the pixel coordinates of the vertices</td></tr><tr><td class=CDLEntry>cx/cy</td><td class=CDLDescription>the center of the polygon object (optional)</td></tr><tr><td class=CDLEntry>type</td><td class=CDLDescription>the Box2D body type (See <a href="#gamvas.Actor.createBody" class=LFunction id=link90 onMouseOver="ShowTip(event, 'tt19', 'link90')" onMouseOut="HideTip('tt19')">gamvas.Actor.createBody</a>) (optional)</td></tr></table><h4 class=CHeading>See</h4><p><a href="#gamvas.Actor.createBody" class=LFunction id=link91 onMouseOver="ShowTip(event, 'tt19', 'link91')" onMouseOut="HideTip('tt19')">gamvas.Actor.createBody</a> <a href="#gamvas.Actor.bodyRect" class=LFunction id=link92 onMouseOver="ShowTip(event, 'tt20', 'link92')" onMouseOut="HideTip('tt20')">gamvas.Actor.bodyRect</a> <a href="#gamvas.Actor.bodyCircle" class=LFunction id=link93 onMouseOver="ShowTip(event, 'tt21', 'link93')" onMouseOut="HideTip('tt21')">gamvas.Actor.bodyCircle</a></p><h4 class=CHeading>Example</h4><p>Create a triangle object with a image of the size 64 by 64 pixels with the center in the middle, at screen position 200, 50</p><blockquote><pre>this.bodyPolygon(200, 50, [ [32, 0], [64, 64], [0, 64] ], 32, 32);</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.resetForces"></a>resetForces</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>resetForces: function(</td><td class="PParameter  prettyprint " nowrap>x,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>y,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>r</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Resets all physical forces on the actor</p><p>When called without parameter, it just stops rotation and movement.&nbsp; With the optional parameters, you can fully reset the actor to its starting position/rotation</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>x/y</td><td class=CDLDescription>The position to set the actor to (optional)</td></tr><tr><td class=CDLEntry>r</td><td class=CDLDescription>The rotation to set the actor to (in radians)</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.setBullet"></a>setBullet</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setBullet: function(</td><td class="PParameter  prettyprint " nowrap>b</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Defines if a actor is a physics &lsquo;bullet&rsquo;.</p><p>A bullet gets increased precision (but slower) collision calculation.&nbsp; Immagine a bullet flying towards a thin piece of metal.&nbsp; In real world, that bullet would hit the metal, no matter what, because the real world is not running in frames per second.&nbsp; The physics simulation on the other hand does, therefor, if the bullet moves very fast, the bullet actually skips through the air, because it traveled a certain amount since the last frame redraw.&nbsp; This can lead to very fast moving objects falling through walles that they would collide when they would move slower, because they skiped a distance larger then this colliding objects width.</p><p>By setting a actor to a bullet, you can ensure that it always collides, even if it skips that part because of the frame based simulation.</p><h4 class=CHeading>Note</h4><p>This is a expensive operation, only use it on important objects (like e.b. the players spaceship) and only if necessary because your objects falls through stuff that it should collide with</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>b</td><td class=CDLDescription>true/false</td></tr></table><h4 class=CHeading>Default</h4><p>false</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.setSensor"></a>setSensor</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setSensor: function(</td><td class="PParameter  prettyprint " nowrap>b</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Defines if a actor is a physics sensor or not</p><p>Sensors do recognize collisions, but are not influenced by the collision forces, so will continue moving as there would not be a collision, but there is one.</p><p>You would use sensors to trigger events, like open a door if the player stands right before it.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>b</td><td class=CDLDescription>true/false</td></tr></table><h4 class=CHeading>Default</h4><p>false</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.setAwake"></a>setAwake</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setAwake: function(</td><td class="PParameter  prettyprint " nowrap>b</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Allows you to wake (or sleep) a actor in the physics simulation</p><p>Sleeping actors are not considered in the simulation, until something hits them.&nbsp; Then they are automatically switched awake.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>b</td><td class=CDLDescription>true/false</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.setFixedRotation"></a>setFixedRotation</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setFixedRotation: function(</td><td class="PParameter  prettyprint " nowrap>b</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Object does not rotate, when under physics controll</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>b</td><td class=CDLDescription>true/false</td></tr></table><h4 class=CHeading>Default</h4><p>false</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.setName"></a>setName</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setName: function(</td><td class="PParameter  prettyprint " nowrap>name</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Set the actor name</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>name</td><td class=CDLDescription>the actors name, must be unique in the game world</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.setRotation"></a>setRotation</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setRotation: function(</td><td class="PParameter  prettyprint " nowrap>r</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Set certain rotation of the actor in radians</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>r</td><td class=CDLDescription>the rotation in radians</td></tr></table><h4 class=CHeading>See</h4><p><a href="#gamvas.Actor.rotate" class=LFunction id=link94 onMouseOver="ShowTip(event, 'tt30', 'link94')" onMouseOut="HideTip('tt30')">gamvas.Actor.rotate</a> <a href="http://en.wikipedia.org/wiki/Radians" class=LURL target=_top>http://en.wikipedia.org/wiki/Radians</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.rotate"></a>rotate</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>rotate: function(</td><td class="PParameter  prettyprint " nowrap>r</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Rotate the actor</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>r</td><td class=CDLDescription>the amount to rotate the actor in radians</td></tr></table><h4 class=CHeading>See</h4><p><a href="#gamvas.Actor.setRotation" class=LFunction id=link95 onMouseOver="ShowTip(event, 'tt29', 'link95')" onMouseOut="HideTip('tt29')">gamvas.Actor.setRotation</a> <a href="http://en.wikipedia.org/wiki/Radians" class=LURL target=_top>http://en.wikipedia.org/wiki/Radians</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.setPosition"></a>setPosition</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setPosition: function(</td><td class="PParameter  prettyprint " nowrap>x,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>y</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Set the position of a actor</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>x/y</td><td class=CDLDescription>the position of the actor in pixels</td></tr></table><h4 class=CHeading>See</h4><p><a href="#gamvas.Actor.move" class=LFunction id=link96 onMouseOver="ShowTip(event, 'tt32', 'link96')" onMouseOut="HideTip('tt32')">gamvas.Actor.move</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.move"></a>move</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>move: function(</td><td class="PParameter  prettyprint " nowrap>x,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>y</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Move the actor</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>x/y</td><td class=CDLDescription>the pixels to move the actor</td></tr></table><h4 class=CHeading>See</h4><p><a href="#gamvas.Actor.setPosition" class=LFunction id=link97 onMouseOver="ShowTip(event, 'tt31', 'link97')" onMouseOut="HideTip('tt31')">gamvas.Actor.setPosition</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.setScale"></a>setScale</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setScale: function(</td><td class="PParameter  prettyprint " nowrap>s</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Set a certain scale factor</p><h4 class=CHeading>Note</h4><p>Do not use scale for objects under physics controll it will work for the image, but not for the collision object</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>the scale value (1 = no scale, &lt; 1 = smaller, &gt; 1 = bigger)</td></tr></table><h4 class=CHeading>See</h4><p><a href="#gamvas.Actor.scale" class=LFunction id=link98 onMouseOver="ShowTip(event, 'tt34', 'link98')" onMouseOut="HideTip('tt34')">gamvas.Actor.scale</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.scale"></a>scale</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>scale: function(</td><td class="PParameter  prettyprint " nowrap>s</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Scale a object</p><h4 class=CHeading>Note</h4><p>Do not use scale for objects under physics controll it will work for the image, but not for the collision object</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>the scale factor (&lt; 0 = shrink, &gt; 0 = enlarge)</td></tr></table><h4 class=CHeading>See</h4><p><a href="#gamvas.Actor.setScale" class=LFunction id=link99 onMouseOver="ShowTip(event, 'tt33', 'link99')" onMouseOut="HideTip('tt33')">gamvas.Actor.setScale</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.setLinearDamping"></a>setLinearDamping</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setLinearDamping: function(</td><td class="PParameter  prettyprint " nowrap>d</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Sets the linear damping of the physics object.</p><p>This means, the higher the value, the more will the object be slowed down while simply &lsquo;rolling along&rsquo;</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.setAngularDamping"></a>setAngularDamping</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setAngularDamping: function(</td><td class="PParameter  prettyprint " nowrap>d</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Sets the angular damping of the physics object.</p><p>A angular damping slows down the rotation of a object over time while no other forces are having impact on it</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.setCenter"></a>setCenter</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setCenter: function(</td><td class="PParameter  prettyprint " nowrap>x,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>y</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Set the center for an actor.&nbsp; If you have a round object for example with a size of 64 by 64 pixels and you want to rotate it around the center, you would use myObject.setCenter(32, 32);</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>x/y</td><td class=CDLDescription>the center, as seen of the upper left corner of the object</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.getCurrentAnimation"></a>getCurrentAnimation</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">getCurrentAnimation: function()</td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Get the current <a href="gamvas-animation-js.html#gamvas.Animation" class=LClass id=link100 onMouseOver="ShowTip(event, 'tt39', 'link100')" onMouseOut="HideTip('tt39')">gamvas.Animation</a> object that is playing</p><h4 class=CHeading>Returns</h4><p><a href="gamvas-animation-js.html#gamvas.Animation" class=LClass id=link101 onMouseOver="ShowTip(event, 'tt39', 'link101')" onMouseOut="HideTip('tt39')">gamvas.Animation</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.getCurrentState"></a>getCurrentState</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">getCurrentState: function()</td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Get the current <a href="gamvas-actorstate-js.html#gamvas.ActorState" class=LClass id=link102 onMouseOver="ShowTip(event, 'tt41', 'link102')" onMouseOut="HideTip('tt41')">gamvas.ActorState</a> the actor is in</p><h4 class=CHeading>Returns</h4><p><a href="gamvas-actorstate-js.html#gamvas.ActorState" class=LClass id=link103 onMouseOver="ShowTip(event, 'tt41', 'link103')" onMouseOut="HideTip('tt41')">gamvas.ActorState</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.setFile"></a>setFile</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setFile: function(</td><td class="PParameter  prettyprint " nowrap>file,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>frameWidth,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>frameHeight,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>numberOfFrames,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>fps</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Sets a image file for the current animation</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>file</td><td class=CDLDescription>a JavaScript Image object holding the animation in tiles</td></tr><tr><td class=CDLEntry>frameWidth</td><td class=CDLDescription>the width of a single frame tile of the animation</td></tr><tr><td class=CDLEntry>frameHeight</td><td class=CDLDescription>the height of a single frame tile of the animation</td></tr><tr><td class=CDLEntry>numberOfFrames</td><td class=CDLDescription>the number of frames in the animation</td></tr><tr><td class=CDLEntry>fps</td><td class=CDLDescription>the speed of the animation in frames per second</td></tr></table><h4 class=CHeading>Example</h4><blockquote><pre>myActor = gamvas.Actor.extend({
    create: function(name, x, y) {
        this._super(name, x,, y);
        var st = gamvas.state.getCurrentState();
        this.setFile(st.resource.getImage('anim.png'), 64, 64, 10, 20);
    }
});</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.preDraw"></a>preDraw</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>preDraw: function(</td><td class="PParameter  prettyprint " nowrap>t</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Gets called after screen clear and before camera handling.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>t</td><td class=CDLDescription>the time since last redraw</td></tr></table><h4 class=CHeading>See</h4><p><a href="gamvas-actorstate-js.html#gamvas.ActorState.update" class=LFunction id=link104 onMouseOver="ShowTip(event, 'tt63', 'link104')" onMouseOut="HideTip('tt63')">gamvas.ActorState.update</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.draw"></a>draw</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>draw: function(</td><td class="PParameter  prettyprint " nowrap>t</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Gets called when the actor is drawn.&nbsp; Usually you would not overwrite this function with your logic, use the <a href="gamvas-actorstate-js.html#gamvas.ActorState.update" class=LFunction id=link105 onMouseOver="ShowTip(event, 'tt63', 'link105')" onMouseOut="HideTip('tt63')">gamvas.ActorState.update</a> function of either the default state or a custom <a href="gamvas-actorstate-js.html#gamvas.ActorState" class=LClass id=link106 onMouseOver="ShowTip(event, 'tt41', 'link106')" onMouseOut="HideTip('tt41')">gamvas.ActorState</a></p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>t</td><td class=CDLDescription>the time since last redraw</td></tr></table><h4 class=CHeading>See</h4><p><a href="gamvas-actorstate-js.html#gamvas.ActorState.update" class=LFunction id=link107 onMouseOver="ShowTip(event, 'tt63', 'link107')" onMouseOut="HideTip('tt63')">gamvas.ActorState.update</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.postDraw"></a>postDraw</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>postDraw: function(</td><td class="PParameter  prettyprint " nowrap>t</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Gets called after camera handling.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>t</td><td class=CDLDescription>the time since last redraw</td></tr></table><h4 class=CHeading>See</h4><p><a href="gamvas-actorstate-js.html#gamvas.ActorState.update" class=LFunction id=link108 onMouseOver="ShowTip(event, 'tt63', 'link108')" onMouseOut="HideTip('tt63')">gamvas.ActorState.update</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.isActive"></a>isActive</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">isActive: function()</td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Check if the actor is active</p><h4 class=CHeading>See</h4><p><a href="#gamvas.Actor.setActive" class=LFunction id=link109 onMouseOver="ShowTip(event, 'tt47', 'link109')" onMouseOut="HideTip('tt47')">gamvas.Actor.setActive</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.setActive"></a>setActive</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setActive: function(</td><td class="PParameter  prettyprint " nowrap>yesno</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Enable or disable the actor for automatic drawing (if in states actors list)</p><h4 class=CHeading>See</h4><p><a href="gamvas-state-state-js.html#gamvas.State.addActor" class=LFunction id=link110 onMouseOver="ShowTip(event, 'tt12', 'link110')" onMouseOut="HideTip('tt12')">gamvas.State.addActor</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.setState"></a>setState</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setState: function(</td><td class="PParameter  prettyprint " nowrap>stateName</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Switch the actor to a certain <a href="gamvas-actorstate-js.html#gamvas.ActorState" class=LClass id=link111 onMouseOver="ShowTip(event, 'tt41', 'link111')" onMouseOut="HideTip('tt41')">gamvas.ActorState</a></p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>stateName</td><td class=CDLDescription>the name of the <a href="gamvas-actorstate-js.html#gamvas.ActorState" class=LClass id=link112 onMouseOver="ShowTip(event, 'tt41', 'link112')" onMouseOut="HideTip('tt41')">gamvas.ActorState</a></td></tr></table><h4 class=CHeading>See</h4><p><a href="gamvas-actorstate-js.html#gamvas.ActorState" class=LClass id=link113 onMouseOver="ShowTip(event, 'tt41', 'link113')" onMouseOut="HideTip('tt41')">gamvas.ActorState</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.setAnimation"></a>setAnimation</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setAnimation: function(</td><td class="PParameter  prettyprint " nowrap>a</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Switch the actor to a certain <a href="gamvas-animation-js.html#gamvas.Animation" class=LClass id=link114 onMouseOver="ShowTip(event, 'tt39', 'link114')" onMouseOut="HideTip('tt39')">gamvas.Animation</a></p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>a</td><td class=CDLDescription>the name of the <a href="gamvas-animation-js.html#gamvas.Animation" class=LClass id=link115 onMouseOver="ShowTip(event, 'tt39', 'link115')" onMouseOut="HideTip('tt39')">gamvas.Animation</a></td></tr></table><h4 class=CHeading>See</h4><p><a href="gamvas-animation-js.html#gamvas.Animation" class=LClass id=link116 onMouseOver="ShowTip(event, 'tt39', 'link116')" onMouseOut="HideTip('tt39')">gamvas.Animation</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.setFPS"></a>setFPS</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setFPS: function(</td><td class="PParameter  prettyprint " nowrap>fps</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets the frames per seconds of the current animation</p><h4 class=CHeading>See</h4><p><a href="gamvas-animation-js.html#gamvas.Animation.setFPS" class=LFunction id=link117 onMouseOver="ShowTip(event, 'tt64', 'link117')" onMouseOut="HideTip('tt64')">gamvas.Animation.setFPS</a> for more information</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.setFrameList"></a>setFrameList</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setFrameList: function(</td><td class="PParameter  prettyprint " nowrap>fl</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets the list of frames of the current animation</p><h4 class=CHeading>See</h4><p><a href="gamvas-animation-js.html#gamvas.Animation.setFrameList" class=LFunction id=link118 onMouseOver="ShowTip(event, 'tt65', 'link118')" onMouseOut="HideTip('tt65')">gamvas.Animation.setFrameList</a> for more information</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.setGroupIndex"></a>setGroupIndex</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setGroupIndex: function(</td><td class="PParameter  prettyprint " nowrap>g</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Set the Box2D filter group index</p><p>All members of a negative group never collide, or of a positive group always collide</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>g</td><td class=CDLDescription>The group index, negative or positive values disable or enable collision</td></tr></table><h4 class=CHeading>Example</h4><p>Set 4 objects group index, so ncol1 and ncol2 never collide with each other but all other objects collide with everything</p><blockquote><pre>this.ncol1.setGroupIndex(-1);
this.ncol2.setGroupIndex(-1);
this.col1.setGroupIndex(1);
this.col2.setGroupIndex(1);</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.setCategoryBits"></a>setCategoryBits</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setCategoryBits: function(</td><td class="PParameter  prettyprint " nowrap>b</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Sets the Box2D category bits</p><p>You can have up to 16 categories for your physics objects like for example player, monster, coins and together with &lt;gamvas.actor.setMaskBits&gt; you can specify which category can collide with which</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>b</td><td class=CDLDescription>a bitfield which category the current object belongs</td></tr></table><h4 class=CHeading>See</h4><p>&lt;gamvas.actor.setMaskBits&gt;</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.setMaskBits"></a>setMaskBits</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setMaskBits: function(</td><td class="PParameter  prettyprint " nowrap>b</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Sets the Box2D mask bits</p><p>You can have up to 16 categories for your physics objects.&nbsp; With the mask bits you specify with which category to collide with, whereas 1 means collide, and 0 means ignore collision.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>b</td><td class=CDLDescription>a bitfield which categories to collide with</td></tr></table><h4 class=CHeading>See</h4><p>&lt;gamvas.actor.setCategoryBits&gt;</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.addRevoluteJoint"></a>addRevoluteJoint</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>addRevoluteJoint: function(</td><td class="PParameter  prettyprint " nowrap>t,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>tp,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>params</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Add a Box2D revolute joint between this actor and another</p><p>Revolute joints are hinge like joints, you can limit their angle and use them as motors.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>t</td><td class=CDLDescription>the target actor</td></tr><tr><td class=CDLEntry>tp</td><td class=CDLDescription>the target position, either as b2Vec2D or <a href="gamvas-vector2d-js.html#gamvas.Vector2D" class=LClass id=link119 onMouseOver="ShowTip(event, 'tt3', 'link119')" onMouseOut="HideTip('tt3')">gamvas.Vector2D</a> (optional)</td></tr><tr><td class=CDLEntry>params</td><td class=CDLDescription>a list of joint parameters, see below (optional)</td></tr></table><h4 class=CHeading>Joint Parameters</h4><p>For detailed description see Box2D manual on <a href="http://box2d.org/manual.html" class=LURL target=_top>http://box2d.org/manual.html</a></p><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>lowerAngle</td><td class=CDLDescription>angle in radians</td></tr><tr><td class=CDLEntry>upperAngle</td><td class=CDLDescription>angle in radians</td></tr><tr><td class=CDLEntry>enableLimit</td><td class=CDLDescription>true/false</td></tr><tr><td class=CDLEntry>maxMotorTorque</td><td class=CDLDescription>maximum torque value</td></tr><tr><td class=CDLEntry>motorSpeed</td><td class=CDLDescription>current motor speed</td></tr><tr><td class=CDLEntry>enableMotor</td><td class=CDLDescription>true/false</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.Actor.addPrismaticJoint"></a>addPrismaticJoint</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>addPrismaticJoint: function(</td><td class="PParameter  prettyprint " nowrap>t,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>tp,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>tv,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>params</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Add a Box2D prismatic joint between this actor and another</p><p>Prismatic joints are joints movable along a axis, similar to springs</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>t</td><td class=CDLDescription>the target actor</td></tr><tr><td class=CDLEntry>tp</td><td class=CDLDescription>the target position, either as b2Vec2D or <a href="gamvas-vector2d-js.html#gamvas.Vector2D" class=LClass id=link120 onMouseOver="ShowTip(event, 'tt3', 'link120')" onMouseOut="HideTip('tt3')">gamvas.Vector2D</a> (optional)</td></tr><tr><td class=CDLEntry>tv</td><td class=CDLDescription>the target vector, aka the direction of the joint, either as b2Vec2D or <a href="gamvas-vector2d-js.html#gamvas.Vector2D" class=LClass id=link121 onMouseOver="ShowTip(event, 'tt3', 'link121')" onMouseOut="HideTip('tt3')">gamvas.Vector2D</a> (optional)</td></tr><tr><td class=CDLEntry>params</td><td class=CDLDescription>a list of joint parameters, see below (optional)</td></tr></table><h4 class=CHeading>Joint Parameters</h4><p>For detailed description see Box2D manual on <a href="http://box2d.org/manual.html" class=LURL target=_top>http://box2d.org/manual.html</a></p><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>upperTranslation</td><td class=CDLDescription>the upper translation limit</td></tr><tr><td class=CDLEntry>lowerTranslation</td><td class=CDLDescription>the lower translation limit</td></tr><tr><td class=CDLEntry>enableLimit</td><td class=CDLDescription>true/false</td></tr><tr><td class=CDLEntry>maxMotorForce</td><td class=CDLDescription>the maximum motor force</td></tr><tr><td class=CDLEntry>motorSpeed</td><td class=CDLDescription>the current motor speed</td></tr><tr><td class=CDLEntry>enableMotor</td><td class=CDLDescription>true/false</td></tr></table><h4 class=CHeading>Note</h4><p>upperTranslation and lowerTranslation should allow the value zero between them, because the joint will start with zero.&nbsp; For example: upperTranslation = -0.2 lowerTranslation = 0.3</p></div></div></div>

</div><!--Content-->


<div id=Footer><a href="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->


<div id=Menu><div class=MEntry><div class=MFile><a href="gamvas-base-js.html">gamvas</a></div></div><div class=MEntry><div class=MFile id=MSelected>gamvas.<wbr>Actor</div></div><div class=MEntry><div class=MFile><a href="gamvas-actorstate-js.html">gamvas.<wbr>ActorState</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-animation-js.html">gamvas.<wbr>Animation</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-astar-js.html">gamvas.<wbr>AStar</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-astargrid-js.html">gamvas.<wbr>AStarGrid</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-astargridnode-js.html">gamvas.<wbr>AStarGridNode</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-astarmap-js.html">gamvas.<wbr>AStarMap</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-astarnode-js.html">gamvas.<wbr>AStarNode</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-camera-js.html">gamvas.<wbr>Camera</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-class-js.html">gamvas.<wbr>Class</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-config-js.html">gamvas.<wbr>config</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-dom-js.html">gamvas.dom</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-event-js.html">gamvas.<wbr>event</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-image-js.html">gamvas.<wbr>Image</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-key-js.html">gamvas.key</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-math-js.html">gamvas.math</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-mouse-js.html">gamvas.<wbr>mouse</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-particleemitter-js.html">gamvas.<wbr>ParticleEmitter</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-physics-js.html">gamvas.<wbr>physics</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-physics-userdata-js.html">gamvas.<wbr>physics.<wbr>UserData</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-rect-js.html">gamvas.Rect</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-resource-js.html">gamvas.<wbr>Resource</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-screen-js.html">gamvas.<wbr>screen</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-sound-js.html">gamvas.<wbr>Sound</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-state-js.html">gamvas.<wbr>state</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-state-state-js.html">gamvas.<wbr>State</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-timer-js.html">gamvas.<wbr>timer</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-vector2d-js.html">gamvas.<wbr>Vector2D</a></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent1')">Index</a><div class=MGroupContent id=MGroupContent1><div class=MEntry><div class=MIndex><a href="../index/General.html">Everything</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Classes.html">Classes</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Functions.html">Functions</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Macros.html">Macros</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Variables.html">Variables</a></div></div></div></div></div><script type="text/javascript"><!--
var searchPanel = new SearchPanel("searchPanel", "HTML", "../search");
--></script><div id=MSearchPanel class=MSearchPanelInactive><input type=text id=MSearchField value=Search onFocus="searchPanel.OnSearchFieldFocus(true)" onBlur="searchPanel.OnSearchFieldFocus(false)" onKeyUp="searchPanel.OnSearchFieldChange()"><select id=MSearchType onFocus="searchPanel.OnSearchTypeFocus(true)" onBlur="searchPanel.OnSearchTypeFocus(false)" onChange="searchPanel.OnSearchTypeChange()"><option  id=MSearchEverything selected value="General">Everything</option><option value="Classes">Classes</option><option value="Functions">Functions</option><option value="Macros">Macros</option><option value="Variables">Variables</option></select></div><script language=JavaScript><!--
HideAllBut([], 2);// --></script></div><!--Menu-->



<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt1"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.name</td></tr></table></blockquote>The name of the actor</div></div><div class=CToolTip id="tt2"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.position</td></tr></table></blockquote>A gamvas.Vector2D object with the position information</div></div><div class=CToolTip id="tt3"><div class=CClass>A 2D vector class</div></div><div class=CToolTip id="tt4"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.center</td></tr></table></blockquote>A gamvas.Vector2D object with the center offset of the actor</div></div><div class=CToolTip id="tt5"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.currentAnimation</td></tr></table></blockquote>The name of the current animation</div></div><div class=CToolTip id="tt6"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.rotation</td></tr></table></blockquote>The rotation of the actor</div></div><div class=CToolTip id="tt7"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.scaleFactor</td></tr></table></blockquote>The scale factor of the object</div></div><div class=CToolTip id="tt8"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.density</td></tr></table></blockquote>The physical property of density. </div></div><div class=CToolTip id="tt9"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.friction</td></tr></table></blockquote>The physical property of friction Defines the friction of objects. </div></div><div class=CToolTip id="tt10"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.type</td></tr></table></blockquote>Allows you to set types to your physics objects to identify them. </div></div><div class=CToolTip id="tt11"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.layer</td></tr></table></blockquote>Integer value used for z-sorting on automatic draw through gamvas.State.addActor</div></div><div class=CToolTip id="tt12"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>addActor: function(</td><td class="PParameter  prettyprint " nowrap>act</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Add a gamvas.Actor to the state. </div></div><div class=CToolTip id="tt13"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.usePhysics</td></tr></table></blockquote>Delivers true/false if this object has physics enabled. </div></div><div class=CToolTip id="tt14"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.body</td></tr></table></blockquote>The Box2D b2Body, if physics is enabled</div></div><div class=CToolTip id="tt15"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.fixture</td></tr></table></blockquote>The Box2D b2Fixture, if physics is enabled</div></div><div class=CToolTip id="tt16"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">init: function()</td></tr></table></blockquote>Description</div></div><div class=CToolTip id="tt17"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>addState: function(</td><td class="PParameter  prettyprint " nowrap>state,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>activate</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Adds a actor state</div></div><div class=CToolTip id="tt18"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>addAnimation: function(</td><td class="PParameter  prettyprint " nowrap>anim</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Adds a animation</div></div><div class=CToolTip id="tt19"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>createBody: function(</td><td class="PParameter  prettyprint " nowrap>type,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>shape</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Create a Box2D b2Body object for the actor. </div></div><div class=CToolTip id="tt20"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>bodyRect: function(</td><td class="PParameter  prettyprint " nowrap>x,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>y,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>width,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>height,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>type</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>make the actor a physics object with a rectangular body shape</div></div><div class=CToolTip id="tt21"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>bodyCircle: function(</td><td class="PParameter  prettyprint " nowrap>x,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>y,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>radius,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>type</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>make the actor a physics object with a circle as body shape</div></div><div class=CToolTip id="tt22"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>bodyPolygon: function(</td><td class="PParameter  prettyprint " nowrap>x,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>y,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>polys,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>cx,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>cy,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>type</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>make the actor a physics object with a non rectangular polygon shape If you just need a rectangle, there is a shortcut: gamvas.actor.bodyRect</div></div><div class=CToolTip id="tt23"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>resetForces: function(</td><td class="PParameter  prettyprint " nowrap>x,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>y,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>r</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Resets all physical forces on the actor</div></div><div class=CToolTip id="tt24"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setBullet: function(</td><td class="PParameter  prettyprint " nowrap>b</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Defines if a actor is a physics &lsquo;bullet&rsquo;.</div></div><div class=CToolTip id="tt25"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setSensor: function(</td><td class="PParameter  prettyprint " nowrap>b</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Defines if a actor is a physics sensor or not</div></div><div class=CToolTip id="tt26"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setAwake: function(</td><td class="PParameter  prettyprint " nowrap>b</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Allows you to wake (or sleep) a actor in the physics simulation</div></div><div class=CToolTip id="tt27"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setFixedRotation: function(</td><td class="PParameter  prettyprint " nowrap>b</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Object does not rotate, when under physics controll</div></div><div class=CToolTip id="tt28"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setName: function(</td><td class="PParameter  prettyprint " nowrap>name</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Set the actor name</div></div><div class=CToolTip id="tt29"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setRotation: function(</td><td class="PParameter  prettyprint " nowrap>r</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Set certain rotation of the actor in radians</div></div><div class=CToolTip id="tt30"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>rotate: function(</td><td class="PParameter  prettyprint " nowrap>r</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Rotate the actor</div></div><div class=CToolTip id="tt31"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setPosition: function(</td><td class="PParameter  prettyprint " nowrap>x,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>y</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Set the position of a actor</div></div><div class=CToolTip id="tt32"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>move: function(</td><td class="PParameter  prettyprint " nowrap>x,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>y</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Move the actor</div></div><div class=CToolTip id="tt33"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setScale: function(</td><td class="PParameter  prettyprint " nowrap>s</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Set a certain scale factor</div></div><div class=CToolTip id="tt34"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>scale: function(</td><td class="PParameter  prettyprint " nowrap>s</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Scale a object</div></div><div class=CToolTip id="tt35"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setLinearDamping: function(</td><td class="PParameter  prettyprint " nowrap>d</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Sets the linear damping of the physics object.</div></div><div class=CToolTip id="tt36"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setAngularDamping: function(</td><td class="PParameter  prettyprint " nowrap>d</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Sets the angular damping of the physics object.</div></div><div class=CToolTip id="tt37"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setCenter: function(</td><td class="PParameter  prettyprint " nowrap>x,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>y</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Set the center for an actor. </div></div><div class=CToolTip id="tt38"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">getCurrentAnimation: function()</td></tr></table></blockquote>Get the current gamvas.Animation object that is playing</div></div><div class=CToolTip id="tt39"><div class=CClass>Class for animated sprites</div></div><div class=CToolTip id="tt40"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">getCurrentState: function()</td></tr></table></blockquote>Get the current gamvas.ActorState the actor is in</div></div><div class=CToolTip id="tt41"><div class=CClass>A class for actor states</div></div><div class=CToolTip id="tt42"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setFile: function(</td><td class="PParameter  prettyprint " nowrap>file,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>frameWidth,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>frameHeight,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>numberOfFrames,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>fps</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Sets a image file for the current animation</div></div><div class=CToolTip id="tt43"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>preDraw: function(</td><td class="PParameter  prettyprint " nowrap>t</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Gets called after screen clear and before camera handling.</div></div><div class=CToolTip id="tt44"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>draw: function(</td><td class="PParameter  prettyprint " nowrap>t</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Gets called when the actor is drawn. </div></div><div class=CToolTip id="tt45"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>postDraw: function(</td><td class="PParameter  prettyprint " nowrap>t</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Gets called after camera handling.</div></div><div class=CToolTip id="tt46"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">isActive: function()</td></tr></table></blockquote>Check if the actor is active</div></div><div class=CToolTip id="tt47"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setActive: function(</td><td class="PParameter  prettyprint " nowrap>yesno</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Enable or disable the actor for automatic drawing (if in states actors list)</div></div><div class=CToolTip id="tt48"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setState: function(</td><td class="PParameter  prettyprint " nowrap>stateName</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Switch the actor to a certain gamvas.ActorState</div></div><div class=CToolTip id="tt49"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setAnimation: function(</td><td class="PParameter  prettyprint " nowrap>a</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Switch the actor to a certain gamvas.Animation</div></div><div class=CToolTip id="tt50"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setFPS: function(</td><td class="PParameter  prettyprint " nowrap>fps</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Sets the frames per seconds of the current animation</div></div><div class=CToolTip id="tt51"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setFrameList: function(</td><td class="PParameter  prettyprint " nowrap>fl</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Sets the list of frames of the current animation</div></div><div class=CToolTip id="tt52"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setGroupIndex: function(</td><td class="PParameter  prettyprint " nowrap>g</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Set the Box2D filter group index</div></div><div class=CToolTip id="tt53"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setCategoryBits: function(</td><td class="PParameter  prettyprint " nowrap>b</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Sets the Box2D category bits</div></div><div class=CToolTip id="tt54"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setMaskBits: function(</td><td class="PParameter  prettyprint " nowrap>b</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Sets the Box2D mask bits</div></div><div class=CToolTip id="tt55"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>addRevoluteJoint: function(</td><td class="PParameter  prettyprint " nowrap>t,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>tp,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>params</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Add a Box2D revolute joint between this actor and another</div></div><div class=CToolTip id="tt56"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>addPrismaticJoint: function(</td><td class="PParameter  prettyprint " nowrap>t,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>tp,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>tv,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>params</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Add a Box2D prismatic joint between this actor and another</div></div><div class=CToolTip id="tt57"><div class=CClass>The basic class for inheritance</div></div><div class=CToolTip id="tt58"><div class=CClass>A plain image with methods to move, rotate and zoom.</div></div><div class=CToolTip id="tt59"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">reverseLayerOrder: false</td></tr></table></blockquote>Reverse layer sorting</div></div><div class=CToolTip id="tt60"><div class=CMacro>define for a dynamic body</div></div><div class=CToolTip id="tt61"><div class=CMacro>define for a static body</div></div><div class=CToolTip id="tt62"><div class=CMacro>define for a kinematic body</div></div><div class=CToolTip id="tt63"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>update: function(</td><td class="PParameter  prettyprint " nowrap>t</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Update the ai. </div></div><div class=CToolTip id="tt64"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setFPS: function(</td><td class="PParameter  prettyprint " nowrap>fps</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Set the speed of the animation in frames per second</div></div><div class=CToolTip id="tt65"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>setFrameList: function(</td><td class="PParameter  prettyprint " nowrap>fl</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Allows to set a list of frames that are considdered to be the animation</div></div><!--END_ND_TOOLTIPS-->




<div id=MSearchResultsWindow><iframe src="" frameborder=0 name=MSearchResults id=MSearchResults></iframe><a href="javascript:searchPanel.CloseResultsWindow()" id=MSearchResultsWindowClose>Close</a></div>


<script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>